package com.zijie.shap;

import java.util.Arrays;

abstract class Shap {
   public abstract void drow();
}

class Triangle extends Shap {
    @Override
    public void drow() {
        System.out.println("△！");
    }
}

class Rect extends Shap {
    @Override
    public void drow() {
        System.out.println("□！");
    }
}

class Circle extends Shap {
    @Override
    public void drow() {
        System.out.println("○！");
    }
}

class Flower extends Shap {
    @Override
    public void drow() {
        System.out.println("❀！");
    }
}

public class Test {
    public static void shap(Shap shap) {
        shap.drow();
    }

    public static void main(String[] args) {
        shap(new Flower());
        System.out.println("============================");
        Shap[] shaps={new Triangle(),new Rect(),new Circle(),new Flower()};
        for (Shap shap:shaps) {
            shap.drow();
        }
    }

}
